Subscribe Us

Responsive Advertisement

Advertisement

276A Lunch Rush codeforces solution in cpp

 276A  Lunch Rush codeforces solution in cpp

by ujjal roy




#include<bits/stdc++.h>

using namespace std;

main()

{


    int n,k,i,f,t;

    cin>>n>>k;

    vector<int> v(n);

    for(i=0;i<n;i++)

    {

        int r;

        cin>>f>>t;

        if(t>k)

        {

            r=f-(t-k);

        }

        else r=f;

        v[i]=r;

    }

    sort(v.rbegin(),v.rend());

    cout<<v[0]<<endl;


    return 0;

}


Post a Comment

0 Comments